package genalgoritm.mediators;

import genalgoritm.views.SettingsView;

import java.util.ArrayList;

import org.apache.commons.math.genetics.CrossoverPolicy;
import org.apache.commons.math.genetics.MutationPolicy;
import org.apache.commons.math.genetics.SelectionPolicy;
import org.apache.commons.math.genetics.StoppingCondition;
import org.eclipse.ui.PlatformUI;

public class ValuesMediator {
	
	private static SettingsView getSettingsView() {
		return (SettingsView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().
		getActivePage().findView(SettingsView.ID);
	}
	
	static public ArrayList<Double> getPoints(){
		return getSettingsView().getPoints();		
	}

	public static double getCrossover() {
		return getSettingsView().getCrossover();
	}
	
	public static double getMutation() {
		return getSettingsView().getMutation();
	}

	public static CrossoverPolicy getCStrategy(Object... params) {
		return getSettingsView().getCStrategy(params);
	}
	
	public static Object[] getCParams() {
		return getSettingsView().getCParams();
	}
	
	public static MutationPolicy getMStrategy(Object... params) {
		return getSettingsView().getMStrategy(params);
	}
	
	public static Object[] getMParams() {
		return getSettingsView().getMParams();
	}
	
	public static SelectionPolicy getSStrategy(Object... params) {
		return getSettingsView().getSStrategy(params);
	}
	
	public static Object[] getSParams() {
		return getSettingsView().getSParams();
	}
	
	public static StoppingCondition getEStrategy(Object... params) {
		return getSettingsView().getEStrategy(params);
	}
	
	public static Object[] getEParams() {
		return getSettingsView().getEParams();
	}
}
